home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / p / pofo / sprachen / pbasic / pbas41 / circle.bas < prev    next >
Encoding:
BASIC Source File  |  1990-11-24  |  561 b   |  26 lines

  1.   rem bj gleason
  2.   rem sample circles
  3.   rem cx,cy are the center x,y coordinates
  4.   rem r is the radius
  5.   screen 6  ' graphics mode
  6.   for cx = 20 to 70 step 10
  7.     r = cx/2   ' draw a series of circles
  8.     cy = 32
  9.     gosub 1000
  10.   next cx
  11.   alarm
  12.   screen 7  ' text mode
  13.   end
  14.  
  15. 1000 ' circle subroutine
  16.   locate cx+r, cy
  17.   stv = 360/r/7  ' step is based on radius
  18.   for theta = 0 to 360 step stv
  19.     angle=theta*3.1415/180
  20.     sx = r*cos(angle)
  21.     sy = r*sin(angle)
  22.     sx = cx+sx : sy = cy+sy
  23.     pset (sx,sy),1
  24.   next theta
  25.   return
  26. ə